

#ifndef __CE_BOUNDING_BOX_H__
#define __CE_BOUNDING_BOX_H__

#include <d3dx9.h>
#include <cegfx/ceexport.h>


class CE_GFX_API ceBoundingBox
{
private:
	D3DXVECTOR3		min;
	D3DXVECTOR3		max;
	D3DXVECTOR3		center;

	D3DXVECTOR3		p[8];
	bool					inited;
public:
	ceBoundingBox ();
	void Clear ();

	void AddVector3 (const D3DXVECTOR3& v);
	void AddVector3 (float x, float y, float z);
	void AddBoundingBox (const ceBoundingBox& bbox);
	void AddBorder (float x, float y, float z);

	void Update ();
	void Transform (const D3DXMATRIX* matrix);
	void Transform (const D3DXMATRIX* matrix, ceBoundingBox* bbox) const;

	const D3DXVECTOR3& GetMin () const;
	const D3DXVECTOR3& GetMax () const;
	const D3DXVECTOR3& GetCenter () const;
	const D3DXVECTOR3* GetPoints () const;

	void Debug (const char* name) const;

};

#endif /* ! __CE_BOUNDING_BOX_H__ */ 
